D:\git\skunkworks\herald-for-cpp\herald\include\herald\payload\fixed\fixed_payload_data_supplier.h
Line | Count | Source |
1 | | // Copyright 2020-2021 Herald Project Contributors |
2 | | // SPDX-License-Identifier: Apache-2.0 |
3 | | // |
4 | | |
5 | | #ifndef HERALD_FIXED_PAYLOAD_DATA_SUPPLIER_H |
6 | | #define HERALD_FIXED_PAYLOAD_DATA_SUPPLIER_H |
7 | | |
8 | | #include "../payload_data_supplier.h" |
9 | | #include "../../datatype/payload_timestamp.h" |
10 | | |
11 | | #include <optional> |
12 | | #include <cstdint> |
13 | | |
14 | | namespace herald { |
15 | | namespace payload { |
16 | | namespace fixed { |
17 | | |
18 | | using namespace herald::datatype; |
19 | | |
20 | | using MYUINT32 = unsigned long; |
21 | | |
22 | | class FixedPayloadDataSupplier { |
23 | | public: |
24 | 2 | FixedPayloadDataSupplier() = default; |
25 | 2 | virtual ~FixedPayloadDataSupplier() = default; |
26 | | }; |
27 | | |
28 | | class ConcreteFixedPayloadDataSupplierV1 : public FixedPayloadDataSupplier { |
29 | | public: |
30 | | ConcreteFixedPayloadDataSupplierV1(std::uint16_t countryCode, std::uint16_t stateCode, |
31 | | std::uint64_t clientId); |
32 | | ~ConcreteFixedPayloadDataSupplierV1(); |
33 | | |
34 | | PayloadData legacyPayload(const PayloadTimestamp timestamp, const Device& device); |
35 | | PayloadData payload(const PayloadTimestamp timestamp, const Device& device); |
36 | | PayloadData payload(const PayloadTimestamp timestamp); |
37 | | PayloadData payload(const Data& data); |
38 | | |
39 | | private: |
40 | | uint16_t country; |
41 | | uint16_t state; |
42 | | uint64_t clientIdentifier; |
43 | | |
44 | | PayloadData mPayload; |
45 | | }; |
46 | | |
47 | | } |
48 | | } |
49 | | } |
50 | | |
51 | | #endif |